<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>后台登录</title>
<meta name="author" content="DeathGhost" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/login/style.css" />
<style>
body{height:100%;background:#16a085;overflow:hidden;}
canvas{z-index:-1;position:absolute;}
</style>
<script src="${pageContext.request.contextPath}/static/js/back/login/jquery.js"></script>
<script src="${pageContext.request.contextPath}/static/js/back/login/Particleground.js"></script>
<script>
$(document).ready(function() {
  //粒子背景特效
  $('body').particleground({
    dotColor: '#5cbdaa',
    lineColor: '#5cbdaa'
  });
  //回车事件绑定
  $("input").bind('keyup', function(event) {
  	if (event.keyCode == "13") {
	  submitLogin();
  	}
  });
});
function submitLogin(){
	var accountname = $("#accountname");
	var password = $("#password");
	var showinfo = $("#showinfo");
	if(accountname.val()==""){
		accountname.focus();
		showinfo.html("账号不能为空！");
		return;
	}else if(password.val()==""){
		password.focus();
		showinfo.html("密码不能为空！");
		return;
	}
	$.post("${pageContext.request.contextPath}/back/login",{
		accountname:accountname.val()
		,password:password.val()
	},function(data){
		if(data=="success"){
			location.href = "${pageContext.request.contextPath}/back/index";
		}else{
			showinfo.html(data);
		}
	});
}
function systeminit(){
	var c = confirm('确定要初始化系统？点击“确定”将会清除系统所用数据！');
	if(c){
		$.post("${pageContext.request.contextPath}/back/systeminit",function(data){
			alert(data);
		});
	}
}
</script>
</head>
<body>
<dl class="admin_login">
 <dt>
  <strong>HMYUAN台管理系统</strong>
  <em style="color: #f66;">如果登陆失败，点击“<a href="javascript:void(0);" onclick="systeminit();">初始化系统</a>”！</em>
 </dt>
 <dd class="user_icon">
  <input id="accountname" type="text" placeholder="账号" class="login_txtbx"/>
 </dd>
 <dd class="pwd_icon">
  <input id="password" type="password" placeholder="密码" class="login_txtbx"/>
 </dd>
 <dd id="showinfo" style="color: rgb(255, 0, 0);font-size: 18px;">
 	超级管理员用户<br>
 	用户名：sysadmin 密码：111111
 </dd>
<!--  <dd class="val_icon">
  <div class="checkcode">
    <input type="text" id="J_codetext" placeholder="验证码" maxlength="4" class="login_txtbx">
    <canvas class="J_codeimg" id="myCanvas" onclick="createCode()">对不起，您的浏览器不支持canvas，请下载最新版浏览器!</canvas>
  </div>
  <input type="button" value="验证码核验" class="ver_btn" onClick="validate();">
 </dd> -->
 <dd>
  <input onclick="submitLogin();" type="button" value="立即登陆" class="submit_btn"/>
 </dd>
 <dd>
  <p>2017 © hmyuan.com All Rights Reserved</p>
  <p>京ICP备17007521号-1</p>
 </dd>
</dl>
</body>
</html>
